package com.heima.user.feign;

import com.heima.apis.user.IUserClient;
import com.heima.model.admin.dtos.AuthDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.pojos.ApUser;
import com.heima.model.user.pojos.ApUserRealname;
import com.heima.user.mapper.ApUserMapper;
import com.heima.user.service.ApUserRealnameService;
import com.heima.user.service.ApUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserClient implements IUserClient {
    @Autowired
    private ApUserRealnameService apUserRealnameServicerService;
    @Autowired
    private ApUserService apUserService;
    @Autowired
    private ApUserMapper mapper;


    @PostMapping("/api/v1/comment/getuser/{id}")
    @Override
    public ResponseResult getUser(@PathVariable Integer id) {
        return ResponseResult.okResult(apUserService.getById(id));
    }

    @Override
    public ResponseResult pageList(@RequestBody AuthDto dto) {
        return apUserRealnameServicerService.pageList(dto);
    }

    @Override
    public ResponseResult authFail(@RequestBody AuthDto dto) {
        return apUserService.authFail(dto);
    }

    @Override
    public ResponseResult authPass(@RequestBody AuthDto dto) {
        return apUserService.authPass(dto);
    }

    }
